function promiseAny(promises){
    return new Promise((resolve,reject) => {
        if(Array.isArray(promises)){
            const reasons = [];
            let count = 0
            promises.forEach((item, index) => {
                Promise.resolve(item).then(
                    value => {
                        resolve(value)
                    },
                    reason => {
                        count ++
                        reasons[index] = reason
                        count === promises.length && reject(new AggregateError(reasons))
                    }
                )
            })
        } else {
            reject(new TypeError('promise is not iteable'))
        }
    })
}